package com.zx.link.entity;

import java.io.Serializable;

/**
 * @Project: link
 * @Title: Link
 * @Description: 网络连接
 * @author: zhangx
 * @date: 2017年3月1日 上午11:35:48
 * @company: webyun
 * @Copyright: Copyright (c) 2017
 * @version v1.0
 */
public class Link implements Serializable {

	private static final long serialVersionUID = 1L;

	private Integer id;

	private String name;

	private Integer tid;

	private byte[] icon;

	private String url;

	/**
	 * 是否已经被删除（逻辑删除），默认=0，1=被删除
	 */
	private Integer isRemove;

	private String decription;

	private String userName;

	private String password;

	/****************************setter***********************************/
	public void setId(Integer id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setTid(Integer tid) {
		this.tid = tid;
	}

	public void setIcon(byte[] icon) {
		this.icon = icon;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public void setIsRemove(Integer isRemove) {
		this.isRemove = isRemove;
	}

	public void setDecription(String decription) {
		this.decription = decription;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	/****************************getter***********************************/
	public Integer getId() {
		return id;
	}

	public String getName() {
		if(name == null)
			return "";
		return name;
	}

	public Integer getTid() {
		if(name == null)
			return 1;
		return tid;
	}

	public byte[] getIcon() {
		return icon;
	}

	public String getUrl() {
		if(url == null)
			return "";
		return url;
	}

	public Integer getIsRemove() {
		if(isRemove == null)
			return 0;
		return isRemove;
	}

	public String getDecription() {
		if(decription == null)
			return "";
		return decription;
	}

	public String getUserName() {
		if(userName == null)
			return "";
		return userName;
	}

	public String getPassword() {
		if(password == null)
			return "";
		return password;
	}

	public String toJSON() {
		return "{\"id\":" + id + ", \"name\":\"" + name + "\", \"_parentId\":" + tid + ", \"icon\":\"" + icon + "\", \"url\":\"" 
				+ url + "\", \"isRemove\":" + isRemove + ", \"decription\":\"" + decription 
				+ "\", \"userName\":\""+userName+"\",\"password\":\""+password+"\"}";
	}

	@Override
	public String toString() {
		return "Link [id=" + id + ", name=" + name + ", tid=" + tid + ", icon=" + icon + ", url=" + url + ", isRemove="
				+ isRemove + ", decription=" + decription + ", userName=" + userName + ", password=" + password + "]";
	}
	

}
